"""shell_mac URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.conf.urls import url, include
from mac.views import generate, operation, delivery_order, jurisdiction

urlpatterns = [
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url('admin/', admin.site.urls),
    # 查看生产计划
    url(r'^production_plan/$', generate.production_plan, name='production_plan'),
    # 退出
    url(r'^mac_logout/$', generate.mac_logout, name='mac_logout'),
    # 登录
    url(r'^$', generate.mac_login, name='mac_login1'),
    url(r'^login/$', generate.mac_login, name='mac_login'),
    # 首页
    url(r'^mac_home/$', generate.mac_home, name='mac_home'),

    url(r'^input_mac/$', generate.input_mac, name='input_mac'),
    url(r'^generate_macs/$', generate.generate_macs, name='generate_macs'),
    url(r'^obtain_macs/(?P<nid>\w+)/(?P<date>.*)$', generate.obtain_macs, name='obtain_macs'),
    url(r'^download_details/$', generate.download_details, name='download_details'),
    # 用户
    url(r'^user_list/$', operation.user_list, name='user_list'),
    url(r'^user_add/$', operation.user_add, name='user_add'),
    url(r'^user_edit/(?P<uid>\w+)$', operation.user_edit, name='user_edit'),
    url(r'^user_delete/(?P<uid>\w+)$', operation.user_delete, name='user_delete'),
    url(r'^user_password_edit/$', operation.user_password_edit, name='user_password_edit'),
    # 部门
    url(r'^department_list/$', operation.department_list, name='department_list'),
    url(r'^department_add/$', operation.department_add, name='department_add'),
    url(r'^department_edit/(?P<did>\w+)$', operation.department_edit, name='department_edit'),
    url(r'^department_delete/(?P<did>\w+)$', operation.department_delete, name='department_delete'),
    # 产品
    url(r'^product_list/$', operation.product_list, name='product_list'),
    url(r'^product_add/$', operation.product_add, name='product_add'),
    url(r'^product_edit/(?P<pid>\w+)$', operation.product_edit, name='product_edit'),
    url(r'^product_delete/(?P<pid>\w+)$', operation.product_delete, name='product_delete'),

    # 批量删除
    url(r'^bulk_delete/$', operation.bulk_delete, name='bulk_delete'),

    # 货物通知单
    url(r'^create_delivery_order/$', delivery_order.create_delivery_order, name='create_delivery_order'),
    url(r'^edit_delivery_order/(?P<oid>\w+)$', delivery_order.edit_delivery_order, name='edit_delivery_order'),
    url(r'^query_delivery_order/$', delivery_order.query_delivery_order, name='query_delivery_order'),
    url(r'^details_delivery_order/(?P<oid>\w+)$', delivery_order.details_delivery_order, name='details_delivery_order'),
    url(r'^check_mac/$', delivery_order.check_mac, name='check_mac'),
    url(r'^order_examine/$', delivery_order.order_examine, name='order_examine'),
    url(r'^show_examine/$', delivery_order.show_examine, name='show_examine'),
    url(r'^download_delivery_mac/(?P<oid>\w+)$', delivery_order.download_delivery_mac, name='download_delivery_mac'),

    # 所有权限列表
    url(r'^jurisdiction_list/$', jurisdiction.jurisdiction_list, name='jurisdiction_list'),
    url(r'^jurisdiction_add/$', jurisdiction.jurisdiction_add, name='jurisdiction_add'),
    url(r'^jurisdiction_delete/(?P<jid>\w+)$', jurisdiction.jurisdiction_delete, name='jurisdiction_delete'),
    url(r'^jurisdiction_edit/(?P<jid>\w+)$', jurisdiction.jurisdiction_edit, name='jurisdiction_edit'),

 ]
